package com.src.myapplication.ui.contor;

import com.src.myapplication.base.OnLoadLiveListListener;
import com.src.myapplication.ui.IView;
import com.src.myapplication.ui.moudle.Mode;

/**
 * Created by Administrator on 2016/10/18.
 */
public class LoginPresenter {

    private Mode mMode;


    private IView mIView;


    public LoginPresenter(IView iView) {
        this.mIView = iView;
        mMode = new Mode();
    }

    //加载数据
    public void lodData() {
        mMode.log(mIView.geturl(), mIView.getben(), new OnLoadLiveListListener() {
            @Override
            public void onSuccess(String list) {
                if (list != null) {
                    //添加集合数据
                    mIView.addList(list);
                }

                //DOTE 隐藏进度条
                mIView.stoprefresh();
            }


            @Override
            public void onFailure(String msg, Throwable e) {
                mIView.showLoadFailMsg();
                //DOTE 隐藏进度条
                mIView.stoprefresh();
            }
        });

    }
//
//    public void query(){
//        mMode.query(misq.getcontext(), new ISQLcaozuo() {
//            @Override
//            public void onSuccess(List<SQLben> data) {
//                if(data!=null){
//                    misq.addlist(data);
//                }
//            }
//        });
//    }
//    public void delecd(){
//        mMode.delete(misq.getcontext(),misq.getdeleid());
//    }
//    public void save(){
//        mMode.save(misq.getcontext(),misq.addsql());
//    }

}
